/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frametampilankasir.java
 *
 * Created on Nov 12, 2011, 12:56:12 AM
 */
package Kasir;

import Transaksi.TransaksiForm;
import javax.swing.JOptionPane;

/**
 *
 * @author Dwi
 */
public class FrameUtamaKasir extends javax.swing.JFrame {

    private Kasir kasir;

    /** Creates new form frametampilankasir */
    public FrameUtamaKasir() {
        initComponents();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Smartcash = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        kasirMenu = new javax.swing.JMenu();
        catatTransaksiMenu = new javax.swing.JMenuItem();
        logout = new javax.swing.JMenuItem();
        exitMenu = new javax.swing.JMenuItem();
        fiturMenu = new javax.swing.JMenu();
        carMenu = new javax.swing.JMenuItem();
        lihatLaporanMenu = new javax.swing.JMenuItem();
        menu_help = new javax.swing.JMenu();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        help_menu = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        Smartcash.setFont(new java.awt.Font("Tahoma", 2, 5));
        Smartcash.setText("Smartcash 1.0");

        kasirMenu.setText("Kasir");

        catatTransaksiMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_BACK_SPACE, java.awt.event.InputEvent.CTRL_MASK));
        catatTransaksiMenu.setText("Catat Transaksi");
        catatTransaksiMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                catatTransaksiMenuMousePressed(evt);
            }
        });
        kasirMenu.add(catatTransaksiMenu);

        logout.setText("logout");
        logout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutActionPerformed(evt);
            }
        });
        kasirMenu.add(logout);

        exitMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        exitMenu.setText("Exit");
        kasirMenu.add(exitMenu);

        jMenuBar1.add(kasirMenu);

        fiturMenu.setText("Fitur");

        carMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        carMenu.setText("Cari Detail Barang");
        carMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                carMenuMousePressed(evt);
            }
        });
        fiturMenu.add(carMenu);

        lihatLaporanMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));
        lihatLaporanMenu.setText("Lihat Laporan");
        fiturMenu.add(lihatLaporanMenu);

        jMenuBar1.add(fiturMenu);

        menu_help.setText("Help");
        menu_help.add(jSeparator1);

        help_menu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.SHIFT_MASK));
        help_menu.setText("Help");
        help_menu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                help_menuMousePressed(evt);
            }
        });
        menu_help.add(help_menu);

        jMenuBar1.add(menu_help);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(366, Short.MAX_VALUE)
                .addComponent(Smartcash))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(259, Short.MAX_VALUE)
                .addComponent(Smartcash, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public void setKasir(Kasir kasir) {
        this.kasir = kasir;
    }

    private void catatTransaksiMenuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_catatTransaksiMenuMousePressed
        TransaksiForm tf = new TransaksiForm();
        tf.setKasir(kasir);
        tf.setVisible(true);
        this.setVisible(false);
        // TODO add your handling code here:
}//GEN-LAST:event_catatTransaksiMenuMousePressed

    private void carMenuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_carMenuMousePressed

        new Frame_cari().setVisible(true);
        this.setVisible(false);
        // TODO add your handling code here:
    }//GEN-LAST:event_carMenuMousePressed

    private void help_menuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_help_menuMousePressed

        new Frame_help().setVisible(true);
        this.setVisible(false);
        // TODO add your handling code here:
    }//GEN-LAST:event_help_menuMousePressed

    private void logoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutActionPerformed

        new LoginForm().setVisible(true);
        this.setVisible(false);
        // TODO add your handling code here:
    }//GEN-LAST:event_logoutActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrameUtamaKasir().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Smartcash;
    private javax.swing.JMenuItem carMenu;
    private javax.swing.JMenuItem catatTransaksiMenu;
    private javax.swing.JMenuItem exitMenu;
    private javax.swing.JMenu fiturMenu;
    private javax.swing.JMenuItem help_menu;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JMenu kasirMenu;
    private javax.swing.JMenuItem lihatLaporanMenu;
    private javax.swing.JMenuItem logout;
    private javax.swing.JMenu menu_help;
    // End of variables declaration//GEN-END:variables
}
